﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace Botonet
{
	public class cDB
	{
        public System.Data.DataSet DS;
        private SqlConnection DBconexion;
        private SqlDataAdapter DBadapter;
        public Exception e;
        
        public cDB()
        {
            DBconexion = new SqlConnection("Data Source=localhost;Initial Catalog=botonet;Integrated Security=True");
            DS = new System.Data.DataSet();
        }
        
        public bool execQuery(string strQuery, string DSlabel)
        {
            try
            {
                this.DS.Clear();
                this.DBadapter = new SqlDataAdapter(strQuery, this.DBconexion);
                this.DBconexion.Open();
                this.DBadapter.Fill(this.DS, DSlabel);
                this.DBconexion.Close();
                return true;
            }
            catch (Exception exception)
            {
                this.e = exception;
                return false;
            }
        }
	}
}